#include<iostream>

using namespace std;

int num[8][9] = {{4, 9, 2, 3, 5, 7, 8, 1, 6},
                 {2, 9, 4, 7, 5, 3, 6, 1, 8},
                 {8, 3, 4, 1, 5, 9, 6, 7, 2},
                 {4, 3, 8, 9, 5, 1, 2, 7, 6},
                 {6, 1, 8, 7, 5, 3, 2, 9, 4},
                 {8, 1, 6, 3, 5, 7, 4, 9, 2},
                 {2, 7, 6, 9, 5, 1, 4, 3, 8},
                 {6, 7, 2, 1, 5, 9, 8, 3, 4}};

int n[9];
int main()
{
    for(int i=0;i<9;i++)
        cin>>n[i];
    //判断
    int cnt = 0;//计数
    int pos;//记住位置
    for(int i=0;i<8;i++)
    {
        int j;
        for(j=0;j<9;j++)
        {
            if(n[j]!=0&&n[j]!=num[i][j])
                break;
        }
        if(j==9)
        {
            cnt++;
            pos = i;
        }
    }
    if(cnt==1)
    {
        for(int i=0;i<9;i++)
        {
            cout<<num[pos][i]<<" ";
            if((i+1)%3==0)
                cout<<endl;
        }

    }
        
    else
        cout<<"Too Many"<<endl;
    return 0;
}
